package com.mooc.yohoshop.ui.car;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mooc.yohoshop.R;
import com.mooc.yohoshop.entity.CarEntity;
import com.mooc.yohoshop.imgload.ImageLoad;

import org.jetbrains.annotations.NotNull;

public class CarGoodsAdapter extends BaseQuickAdapter<CarEntity.CarGoodsValues, BaseViewHolder> {

    public CarGoodsAdapter() {
        super(R.layout.item_carlist);

    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, CarEntity.CarGoodsValues carGoodsValues) {
        ImageLoad.loadMatchUrl(carGoodsValues.car_path,baseViewHolder.getView(R.id.carlist_item_img));
        baseViewHolder.setText(R.id.carlist_item_num,"X"+carGoodsValues.shop_num);
        baseViewHolder.setText(R.id.carlist_item_title,carGoodsValues.shop_name);
        baseViewHolder.setText(R.id.carlist_item_values,
                "尺寸"+carGoodsValues.shop_size+"颜色"+carGoodsValues.shop_color);
        baseViewHolder.setText(R.id.carlist_item_price, "¥"+carGoodsValues.shop_price);
    }
}
